<?php

class LogoutController extends Controller
{
	public $defaultAction = 'logout';
	
	/**
	 * Logout the current user and redirect to returnLogoutUrl.
	 */
	public function actionLogout()
	{
		//Yii::app()->user->logout();
		//ApplicationSessions::run()->deleteAll();
		ApplicationSessions::run()->delete('admin_id');
		ApplicationSessions::run()->delete('admin_email');
		ApplicationSessions::run()->delete('admin_username');
		ApplicationSessions::run()->delete('role_id');
		ApplicationSessions::run()->delete('type');
		//Yii::app()->getModule('admin')->admin->logout();
		$this->redirect(Yii::app()->controller->module->returnLogoutUrl);
	}

}